package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

public class DiseaseInfoListRequest extends Request{

	private static final long serialVersionUID = 1487448613293224261L;

	private Integer userId;
	private Integer pageNo;
	private Integer pageSize;
	private Integer status;
	
	@Override
	public void parse(HttpServletRequest request) {
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), 0);
		this.status = requestInfo.getIntParameter(ApiUrlParamEnum.status.getParamName(), -1);
		this.pageNo = requestInfo.getIntParameter(ApiUrlParamEnum.pageNo.getParamName(), 1);
		this.pageSize = requestInfo.getIntParameter(ApiUrlParamEnum.pageSize.getParamName(), 10);

		if(userId<1){
			throw new RequestIllegalException("error userId: " + userId);
		}
		if(status<0){
			throw new RequestIllegalException("error status: " + status);
		}
		
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Integer getPageNo() {
		return pageNo;
	}

	public void setPageNo(Integer pageNo) {
		this.pageNo = pageNo;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	
}
